
<?php
if (isset($Error)) {
  echo $cargar->msj_error($Error);
} if (isset($Exito)) {
  echo $cargar->msj_exito($Exito);
}
$contrl = 'lubricantes';
$vista = 'Vehiculo';
$diva = $cargar->div('l');
$divb = $cargar->div('v');
?>

<?= $cargar->hoja('center'); ?>
<? echo $ajax->form('formulario', 'post', array('url' => '/' . $contrl . '/guardar', 'update' => $diva, 'id' => 'formulario')); ?>
<? echo $form->input('id', array('id' => 'id', 'label' => false, 'type' => 'hidden', 'div' => false, 'error' => false, 'value' => $data['Vehiculo']['id'])); ?>
    <?
echo $form->input('busq', array('id' => 'busq', 'label' => false, 'type' => 'hidden', 'div' => false, 'error' => false, 'value' => $busq));
echo $form->input('donde', array('id' => 'donde', 'label' => false, 'type' => 'hidden', 'div' => false, 'error' => false, 'value' => $donde));
?>
<?= $cargar->marcorojo("MODIFICAR " . $cargar->mayuscula($vista)." ". $data['Vehiculo']['id']); ?>

<?= $cargar->tabla(0, 5, 'center'); ?>

<tr>
  <td align="center">
    <?
    echo $cargar->cerrar(0);
    echo $cargar->linkng('botones', '', $cargar->botones('cerrar', 'nav_logo27.png', 'no'), '/' . $contrl . '/listado/' . $donde . "/" . $busq, 'cont_veh');
    echo $cargar->cerrar(1);
    ?>
  </td>
</tr>

<tr>
  <td align='center'>
    <?= $cargar->marcoazul('Descripción del Vehiculo'); ?>
    <table border='0' cellpadding='0' cellspacing='5' width='100%' align='center'>


      <tr align='left'>
        <td width='180px' id='td' align='right'>Marca:</td>
        <td width='180px'><? echo $form->select('marca', null, $data['Vehiculo']['marca_id'], array('id' => 'marca', 'style' => '100%', 'class' => 'inputn'), $data['Marca']['nombre'], false); ?>
        </td>    
        <td width='120px' id='td' align='right'>Modelo:</td>
        <td><? echo $form->select('modelo', null, $data['Vehiculo']['modelo_id'], array('id' => 'modelo', 'style' => '100%', 'class' => 'inputn'), $data['Modelo']['nombre'], false); ?>
        </td>

      </tr>
      <tr align='left'>
        <td width='180px' id='td' align='right'>Tipo:</td>
        <td width='180px'><? echo $form->select('tipo', null, $data['Vehiculo']['tipo_vehiculo_id'], array('id' => 'tipo', 'style' => '100%', 'class' => 'inputn'), $data['Tipo_vehiculo']['nombre'], false); ?>
        </td>    
        <td width='120px' id='td' align='right'>Año:</td>
        <td>
          <? echo $form->select('anio', null, $data['Vehiculo']['anio'], array('id' => 'anio', 'style' => '100%', 'class' => 'inputn'), $data['Vehiculo']['anio'], false); ?>
          
          <? // echo $form->year('anio',1950,date('Y'),null,null,'Seleccione',false);?>
          <? //year($fieldName, $minYear = null, $maxYear = null, $selected = null, $attributes = array(), $showEmpty = true) ; ?>
        </td>

      </tr>

      <tr align='left'>

        <td width='180px' id='td' align='right'>Clase:</td>
        <td width='180px'><? echo $form->select('clase', null, $data['Vehiculo']['clase_id'], array('id' => 'clase', 'style' => '100%', 'class' => 'inputn'), $data['Clase']['nombre'], false); ?>
        </td>    
        <td width='120px' id='td' align='right'>Gps:</td>
        <? if($data['Vehiculo']['gps_id']!=null) $si_='SI'; else $si_='NO';?>
        <td><? echo $form->select('sino', null, $si_, array('id' => 'sino', 'style' => '100%', 'class' => 'inputn', 'onchange' => "input_remoto('/vehiculos/gps/".$data['Vehiculo']['id']."','gps_tr',this.value)"),$si, false);
        //echo $form->select('sino', null, null, array('id' => 'sino', 'style' => '100%', 'class' => 'inputn'), 'Seleccione', false); ?>

        </td>

      </tr>   


      <tr align='left' id="gps_tr">
     <? if($data['Vehiculo']['gps_id']!=null) {?>
 <td width='180px' id='td' align='right'>Modelo Gps:</td>
        <td width='180px'><? echo $form->select('modelo_gps', null, $data['Vehiculo']['gps_id'], array('id' => 'modelo_gps', 'style' => '100%', 'class' => 'inputn'), $data['Vehiculo']['gps_id'], false); ?></td>

      <td width='120px' id='td' align='right'>N° SIM Gps:</td>
        <td><? echo $form->input('n_gps', array('id' => 'n_gps', 'label' => false, 'type' => 'text', 'div' => false, 'error' => false, 'size' => '12', 'class' => 'inputn','value'=>$sim['Gps_vehiculo']['sim'])); ?>
        </td>


<? } ?>
          
          
     
      </tr>       
    
    </table>

  </td>
</tr>



<tr>
  <td align='center'>
    <?= $cargar->marcoazul('Datos del Vehiculo'); ?>
    <table border='0' cellpadding='0' cellspacing='5' width='100%' align='center'>


      <tr align='left'>

        <td width='180px' id='td' align='right'>Serial de Motor:</td>
        <td width='180px'><? echo $form->input('serial_motor', array('id' => 'serial_motor', 'label' => false, 'type' => 'text', 'div' => false, 'error' => false, 'size' => '20', 'class' => 'inputn','value'=>$data['Vehiculo']['serial_motor'],'readonly'=>'readonly')); ?>
        </td>    
        <td width='120px' id='td' align='right'>Chasis:</td>
        <td><? echo $form->input('chasis', array('id' => 'chasis', 'label' => false, 'type' => 'text', 'div' => false, 'error' => false, 'size' => '20', 'class' => 'inputn','value'=>$data['Vehiculo']['chasis'],'readonly'=>'readonly')); ?>
        </td>

      </tr>
      <tr align='left'>
        <td width='180px' id='td' align='right'>Serial de Carroceria:</td>
        <td width='180px'><? echo $form->input('serial_carroceria', array('id' => 'serial_carroceria', 'label' => false, 'type' => 'text', 'div' => false, 'error' => false, 'size' => '20', 'class' => 'inputn','value'=>$data['Vehiculo']['serial_carroceria'],'readonly'=>'readonly')); ?>
        </td>    
        <td width='120px' id='td' align='right'>Placa:</td>
        <td><? echo $form->input('placa', array('id' => 'placa', 'label' => false, 'type' => 'text', 'div' => false, 'error' => false, 'size' => '20', 'class' => 'inputn','value'=>$data['Vehiculo']['placa'],'readonly'=>'readonly')); ?>
        </td>

      </tr>

      <tr align='left'>

        <td width='180px' id='td' align='right'>Color:</td>
        <td width='180px'><? echo $form->input('color', array('id' => 'color', 'label' => false, 'type' => 'text', 'div' => false, 'error' => false, 'size' => '20', 'class' => 'inputn','value'=>$data['Vehiculo']['color'],'readonly'=>'readonly')); ?>
        </td>    
        <td width='120px' id='td' align='right'>Uso:</td>
        <td><? echo $form->select('uso', $Uso, $data['Vehiculo']['uso_id'], array('id' => 'uso', 'style' => '100%', 'class' => 'inputn','readonly'=>'readonly'), 'Seleccione', false); ?>
        </td>

      </tr>   
    </table>

  </td>
</tr>


















<tr>
  <td align='center'>
    <br />
    <input type="button" value="Guardar <?=$vista?>" disabled /> 
        
        <? //echo $form->submit("Guardar $vista", array('div' => false, 'class' => 'accion_continuar', null)); ?>
  </td>
</tr>


</table>
</fieldset>





<?= $cargar->hoja(); ?>


 <script type="text/javascript">
var cal = Calendar.setup(
 {
	  weekNumbers: true,
	  showTime   : 5,
	  fdow       : 1,
	  timePos    :'left', 
	  onSelect: function(cal)
	  {
		cal.hide();
		cal.redraw();
	  }
 });
  <? for($i=0; $i<count($Poliza); $i++){ ?>
  cal.manageFields("<?=$Poliza[$i]['Poliza']['disminutivo'].'_fecha';?>","<?=$Poliza[$i]['Poliza']['disminutivo'].'_fecha';?>", "%d-%m-%Y");
  
  <? } ?>
  </script> 
  <div id='prueba'></div>

















